home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Panorama / Panorama - Disk 30C (1988-06-22)(Pacific North-West Amigas Club)[WB].zip / Panorama - Disk 30C (1988-06-22)(Pacific North-West Amigas Club)[WB].adf / Leach1.3 / gad.h < prev    next >
C/C++ Source or Header  |  1988-06-06  |  4KB  |  163 lines

  1. /******************************************************************************
  2.  *                    Gadget Data Structure Definitions
  3.  *
  4.  *    THIS FILE USES 4 COLUMN TABS!
  5.  *
  6.  *    This include file contains gadget structure definitions and declarations
  7.  *    for Leach's status window. There are two gadgets: one for showing or 
  8.  *    hiding the ruler and one for enabling and disabling ruler movement. Each
  9.  *    gadget has an associated IntuiText structure.
  10.  *
  11.  *    This file can be included in just one .C file cause it allocates storage.
  12.  *
  13.  *    GADGET STRUCT FYI:
  14.  *
  15.  *    struct Gadget
  16.  *    {
  17.  *        struct Gadget        *NextGadget;
  18.  *        SHORT                LeftEdge, TopEdge;
  19.  *        SHORT                Width, Height;
  20.  *        USHORT                Flags;
  21.  *        USHORT                Activation;
  22.  *        USHORT                GadgetType;
  23.  *        APTR                GadgetRender;
  24.  *        APTR                SelectRender;
  25.  *        struct IntuiText    *GadgetText;
  26.  *        LONG                MutualExclude;        Not implemented in Ver 1.2
  27.  *        APTR                SpecialInfo;
  28.  *        USHORT                GadgetID;
  29.  *        APTR                UserData;
  30.  *    };
  31.  *
  32.  *    struct IntuiText
  33.  *    {
  34.  *        UBYTE                FrontPen, BackPen;
  35.  *        UBYTE                DrawMode;
  36.  *        short                LeftEdge, TopEdge;
  37.  *        struct TextAttr        *ITextFont;
  38.  *        UBYTE                *IText;
  39.  *        struct IntuiText    *NextText;
  40.  *    };
  41.  *
  42.  ******************************************************************************/
  43.  
  44. #define    GHGT    8
  45. #define    XOR        COMPLEMENT
  46.  
  47. extern UBYTE    statustext[];        /* Status window text string.    */
  48.  
  49. /* These 8-character (+ EOS) strings are displayed in the gadget select boxes */
  50.  
  51. UBYTE    show_text[] = " SHOW ";
  52. UBYTE    hide_text[]    = " HIDE ";
  53. UBYTE    move_text[]    = "  MOVE  ";
  54. UBYTE    frez_text[]    = " FREEZE ";
  55. UBYTE    left_text[] = "<";
  56. UBYTE    rite_text[] = ">";
  57.  
  58. struct IntuiText    gad_text[] =
  59. {
  60. {                        /* For SHOW/HIDE gadget                */
  61.     0, 1,
  62.     JAM2,
  63.     0, 0,                /* Relative to gadget select box.    */
  64.     NULL,                /* Use default font.                */
  65.     show_text,
  66.     NULL                /* No more text.                    */
  67. },
  68. {                        /* For MOVE/FREEZE gadget            */
  69.     0, 1,
  70.     JAM2,
  71.     0, 0,
  72.     NULL,
  73.     move_text,
  74.     NULL
  75. },
  76. {                        /* For left color gadget        */
  77.     0, 1,
  78.     JAM2,
  79.     0, 0,
  80.     NULL,
  81.     left_text,
  82.     NULL
  83. },
  84. {                        /* For rite color gadget        */
  85.     0, 1,
  86.     JAM2,
  87.     0, 0,
  88.     NULL,
  89.     rite_text,
  90.     NULL
  91. }
  92. };    /*  end of gad_text[] initialization  */
  93.  
  94. struct Gadget        swind_gad[] =
  95. {
  96. {                                /* SHOW/HIDE GADGET                */
  97.     &swind_gad[1],                /* Address of next gadget.        */
  98.     488, 11,                    /* LeftEdge, TopEdge            */
  99.     6 * 8, GHGT,                /* Width, Height                */
  100.     GADGHNONE,                    /* Flags                        */
  101.     TOGGLESELECT |                /* Activation                    */
  102.     RELVERIFY,
  103.     BOOLGADGET,                    /* GadgetType                    */
  104.     NULL,                        /* GadgetRender                    */
  105.     NULL,                        /* SelectRender                    */
  106.     &gad_text[0],                /* Show/Hide text                */
  107.     NULL,                        /* Mutual exclude                */
  108.     NULL,                        /* SpecialInfo                    */
  109.     0,                            /* GadgetID                        */
  110.     (APTR) &hide_text[0]        /* Alternate text for gadget    */
  111. },
  112. {                                /* MOVE/FREEZE GADGET            */
  113.     &swind_gad[2],                /* Address of next gadget.        */
  114.     488 + 6*8 + 4, 11,            /* LeftEdge, TopEdge            */
  115.     8*8, GHGT,
  116.     GADGHNONE | GADGDISABLED,
  117.     TOGGLESELECT | RELVERIFY,
  118.     BOOLGADGET,
  119.     NULL,
  120.     NULL,
  121.     &gad_text[1],
  122.     NULL,
  123.     NULL,
  124.     0,
  125.     (APTR) &frez_text[0]        /* Alternate text for gadget        */
  126. },
  127. {                                /* Left color GADGET            */
  128.     &swind_gad[3],                /* Address of next gadget.        */
  129.     488 + (6+8)*8 + 2*4 ,11,    /* LeftEdge, TopEdge            */
  130.     8, GHGT,                    /* Width, Height                */
  131.     GADGHCOMP,                    /* Flags                        */
  132.     RELVERIFY,                    /* Activation                    */
  133.     BOOLGADGET,                    /* GadgetType                    */
  134.     NULL,                        /* GadgetRender                    */
  135.     NULL,                        /* SelectRender                    */
  136.     &gad_text[2],
  137.     NULL,                        /* Mutual exclude                */
  138.     NULL,                        /* SpecialInfo                    */
  139.     0,                            /* GadgetID                        */
  140.     NULL
  141. },
  142. {                                /* Right color GADGET            */
  143.     NULL,                        /* Last gadget in list            */
  144.     488 + (6+8+1)*8 + 3*4 ,11,    /* LeftEdge, TopEdge            */
  145.     8, GHGT,                    /* Width, Height                */
  146.     GADGHCOMP,                    /* Flags                        */
  147.     RELVERIFY,                    /* Activation                    */
  148.     BOOLGADGET,                    /* GadgetType                    */
  149.     NULL,                        /* GadgetRender                    */
  150.     NULL,                        /* SelectRender                    */
  151.     &gad_text[3],
  152.     NULL,                        /* Mutual exclude                */
  153.     NULL,                        /* SpecialInfo                    */
  154.     0,                            /* GadgetID                        */
  155.     NULL
  156. },
  157. };    /*  end of swind_gad[] initialization  */
  158.  
  159. #define SHOWGAD    swind_gad[0]
  160. #define MOVEGAD    swind_gad[1]
  161.  
  162.  
  163.